#include "precompile.h"

#include "Form.h"

Form::Form()
{
}

Form::~Form()
{
}

void Form::ExchangePacket(Packet& packet)
{
	PacketExchanged()(_getself<IForm>(this),packet);
}

bool Form::Show(showAction action)
{
	return Showed()(_getself<IForm>(this),action,false);
}

void Form::Close()
{
	Closed()(_getself<IForm>(this));
}

bool Form::ShowModal()
{
	bool result = Showed()(_getself<IForm>(this),sa_show,true);
	Close();
	return result;
}

bool Form::ShowModalLoop(Packet& packet)
{
	PacketExchanged()(_getself<IForm>(this),packet);
	bool result = Showed()(_getself<IForm>(this),sa_show,true);
	Close();
	return result;
}

void Form::Setwindow(uintptr window)
{
	m_window =  window;
}

uintptr Form::Getwindow() const
{
	return m_window;
}

void Form::Reset()
{
	m_window = NULL;
}